#include <iostream>
#include <string>

bool IsPalindrome(std::string& s) {
	int n = s.length();
	for (int i = 0; i < n / 2; i++) {
		if (s[i] != s[n - i - 1]) {
			return false;
		}
	}
	return true;
}

/**
 * 回文数
 * 测试链接：https://www.luogu.com.cn/problem/B4039
 * 
 * 考点：字符串操作
 * @return 
 */
int main() {
	int n, k;
	std::cin >> n;
	for (int i = 0; i < n; i++) {
		std::string s;
		std::cin >> s;
		int m = s.length();
		bool found = false;
		for (int j = 2; j <= m - 2; j++) {
			std::string s1 = s.substr(0, j);
			std::string s2 = s.substr(j, m - j);

			if (IsPalindrome(s1) && IsPalindrome(s2)) {
				found = true;
				break;
			}
		}

		if (found) {
			std::cout << "Yes\n";
		}
		else {
			std::cout << "No\n";
		}
	}

	return 0;	
}